<template>
  <div class="content">
    <div class="header-card">
      <jc-button
        :btn-arr="['pass', 'sub', 'save', 'reload', 'option', 'remove', 'list']"
        :disab-arr="[isDisabled && 'save', 'close', 'cancel', 'toExcel', 'freeze', 'com1', 'com2', 'chart']"
        :list="'/customerList'"
        @refresh="getForm"
        @save="save"
        @submit="save(1)"
        @noSubmit="materSub(2)"
        @audit="Retrial(1)"
        @noAudit="Retrial(2)"
        @forbidden="using(1)"
        @startUsing="using(2)"
        @del="delCustom"
      />
      <div class="organization">
        <el-form
          ref="nameRef"
          label-width="100px"
          size="mini"
          :model="organization"
          :rules="nameRules"
        >
          <el-form-item :label="$t('market.custname')" prop="fname">
            <el-input
              v-model="organization.fname"
              class="input-width"
              :disabled="isDisabled"
            />
          </el-form-item>
          <el-form-item :label="$t('market.customerNo')" prop="fcode">
            <el-input
              v-model="organization.fcode"
              class="input-width"
              disabled
            />
          </el-form-item>
          <el-form-item :label="$t('market.state')" prop="fcode">
            <el-tag :type="organization.stateColor">{{ organization.fdocumentStatus }}</el-tag>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane :label="$t('market.info2')" name="customer" class="customer">
        <jc-title :title1="$t('market.info')" />
        <div class="basic-information">
          <el-form
            ref="basicRef"
            label-width="100px"
            size="mini"
            :model="basic"
            class="spacing"
            :rules="basicRules"
          >
            <el-form-item :label="$t('market.country')" prop="fcountry">
              <el-input
                v-model="basic.fcountryName"
                class="input-width"
                :disabled="isDisabled"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="openCountry=true"
                />
              </el-input>
            </el-form-item>
            <el-form-item :label="$t('market.website')" prop="fwebsite">
              <el-input
                v-model="basic.fwebsite"
                class="input-width"
                :disabled="isDisabled"
              />
            </el-form-item>
            <el-form-item :label="$t('market.addressBook')" prop="faddress" style="height: 50px;">
              <el-input
                v-model="basic.faddress"
                class="input-width"
                type="textarea"
                :disabled="isDisabled"
              >
                <i slot="suffix" class="el-input__icon el-icon-search" />
              </el-input>
            </el-form-item>
          </el-form>
          <el-form
            ref="callRef"
            label-width="100px"
            size="mini"
            :model="administration"
            class="spacing"
            :rules="adminRules"
          >
            <el-form-item :label="$t('market.ftel')" prop="ftel">
              <el-input
                v-model="administration.ftel"
                class="input-width"
                :disabled="isDisabled"
              />
            </el-form-item>
            <el-form-item :label="$t('market.ffax')" prop="ffax">
              <el-input
                v-model="administration.ffax"
                class="input-width"
                :disabled="isDisabled"
              />
            </el-form-item>
            <el-form-item :label="$t('market.taxregistercode')" prop="ftaxregistercode">
              <el-input
                v-model="administration.ftaxregistercode"
                class="input-width"
                :disabled="isDisabled"
              />
            </el-form-item>
            <el-form-item :label="$t('market.companyclassify')" prop="fcompanyclassifyName">
              <el-autocomplete
                v-model.trim="administration.fcompanyclassifyName"
                highlight-first-item
                popper-class="my-autocomplete"
                :fetch-suggestions="querySearch18"
                size="mini"
                :popper-append-to-body="false"
                :disabled="isDisabled"
                @focus="getBasicUnit('SX_COMPANYTYPE')"
                @select="selUnit"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="cliUnit('SX_COMPANYTYPE')"
                />
                <template slot-scope="{ item }">
                  <div class="name">{{ item.fname }}</div>
                </template>
              </el-autocomplete>
            </el-form-item>
            <el-form-item :label="$t('market.companynature')" prop="fcompanynatureName">
              <el-autocomplete
                v-model.trim="administration.fcompanynatureName"
                highlight-first-item
                popper-class="my-autocomplete"
                :fetch-suggestions="querySearch18"
                :disabled="isDisabled"
                :popper-append-to-body="false"
                @focus="getBasicUnit('SX_COMPANYNATURE')"
                @select="selUnit"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="cliUnit('SX_COMPANYNATURE')"
                />
                <template slot-scope="{ item }">
                  <div class="name">{{ item.fname }}</div>
                </template>
              </el-autocomplete>
            </el-form-item>
            <el-form-item :label="$t('market.companyscale')" prop="fcompanyscaleName">
              <el-autocomplete
                v-model.trim="administration.fcompanyscaleName"
                highlight-first-item
                popper-class="my-autocomplete"
                :fetch-suggestions="querySearch18"
                :disabled="isDisabled"
                :popper-append-to-body="false"
                @focus="getBasicUnit('SX_COMPANYSCALE')"
                @select="selUnit"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="cliUnit('SX_COMPANYSCALE')"
                />
                <template slot-scope="{ item }">
                  <div class="name">{{ item.fname }}</div>
                </template>
              </el-autocomplete>
            </el-form-item>
          </el-form>
          <el-form
            ref="customerRef"
            label-width="100px"
            size="mini"
            :model="relevant"
            class="spacing"
            :rules="relevantRules"
          >
            <el-form-item :label="$t('market.custType')" prop="fcustTypeId">
              <el-autocomplete
                v-model.trim="relevant.fcustTypeName"
                highlight-first-item
                popper-class="my-autocomplete"
                :fetch-suggestions="querySearch18"
                :disabled="isDisabled"
                :popper-append-to-body="false"
                @focus="getBasicUnit('SX_CUSTCATEGORY')"
                @select="selUnit"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="cliUnit('SX_CUSTCATEGORY')"
                />
                <template slot-scope="{ item }">
                  <div class="name">{{ item.fname }}</div>
                </template>
              </el-autocomplete>
            </el-form-item>
            <el-form-item :label="$t('market.custGroup')" prop="fgroup">
              <el-input
                v-model="relevant.fgroupName"
                class="input-width"
                :disabled="isDisabled"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="handleGroup"
                />
              </el-input>
            </el-form-item>
            <!--            <el-form-item label="对应组织" prop="fcorrespondorgid">-->
            <!--              <el-select v-model="relevant.fcorrespondorgid" class="input-width"  :disabled="isDisabled">-->
            <!--                <el-option-->
            <!--                  v-for="option in teamList"-->
            <!--                  :key="option.fid"-->
            <!--                  :label="option.fname"-->
            <!--                  :value="option.fid"-->
            <!--                />-->
            <!--              </el-select>-->
            <!--            </el-form-item>-->
            <el-form-item :label="$t('market.supplier')" prop="fsupplier">
              <el-input
                v-model="relevant.fsupplier"
                class="input-width"
                :disabled="isDisabled"
              >
                <i
                  slot="suffix"
                  class="el-input__icon el-icon-search"
                  @click="supplierVisiblit=true"
                />
              </el-input>
            </el-form-item>
            <el-form-item :label="$t('market.note')" prop="fdescription" style="height: 50px;">
              <el-input
                v-model="relevant.fdescription"
                class="input-width"
                type="textarea"
                :disabled="isDisabled"
              >
                <i slot="suffix" class="el-input__icon el-icon-search" />
              </el-input>
            </el-form-item>
          </el-form>
        </div>
        <jc-title :title1="$t('market.linkman')" />
        <jc-contacts ref="contactsRef" :contacts-value="contactsValue" :form-disabled="isDisabled" />
        <jc-title :title1="$t('market.businessInfo')" />
        <jc-business ref="businessRef" :business.sync="business" :form-disabled="isDisabled" />
        <jc-title :title1="$t('market.bankInfo')" :division="false" />
        <jc-bank :table-bank-data.sync="tableBankData" :form-disabled="isDisabled" />
      </el-tab-pane>
      <el-tab-pane :label="$t('market.record1')" name="log">
        <jc-marker
          ref="log"
          :fnumber="organization.fcode"
          other-height="61vh"
          :other-url-object="otherUrlObject"
        />
      </el-tab-pane>
    </el-tabs>
    <el-dialog
      v-dialogDrag
      class="dialog-class"
      :title="$t('market.custGroup')"
      model
      :visible.sync="openCustomer"
      :close-on-click-modal="false"
      width="500px"
      top="5vh"
    >
      <div class="public-form">
        <el-tree
          :data="relevant.fgroupArray"
          :props="defaultProps"
          @node-click="handleNodeClick"
        />
      </div>
    </el-dialog>
    <!--    国家-->
    <country v-if="openCountry" @country="countrySelectRow" />
    <!--  数据字典弹窗  -->
    <unit v-if="unitVisabled" :msg="funit" @unit="selUnit" />
    <!--供应商-->
    <supplier v-if="supplierVisiblit" @supplier="supplierData" />
  </div>
</template>

<script>
import jcTitle from '@/components/Title'
import JcBank from '@/views/market/customer/createCustomer/bank'
import JcBusiness from '@/views/market/customer/createCustomer/business'
import JcContacts from '@/views/market/customer/createCustomer/contacts'
import searData from '@/components/Search/mixin'
import { queryCustomerDetails } from '@/api/marketManage/customer/detailCustomer'
import {
  updateCustomer
} from '@/api/marketManage/customer/editCustomer'
import {
  // 客户分组
  queryCustomerGroup
} from '@/api/marketManage/customer/createCustomer'
import operability from '@/mixin/Operability'
import { toMxAmina } from '@/components/ToMxamineState'
import {
  custAudit,
  custAuSubmit,
  custSubmit,
  custUnAudit, deleteCustomer,
  disableCust,
  undisableCust
} from '@/api/basicManagement/userslist'
import autocomplete from '@/views/market/marketManage/createMarkerOrder/components/autocomplete'
import jcMarker from '@/components/marker'
import jcButton from '@/components/Button'
import bility from '@/mixin/Operability'
export default {
  name: 'CreateCustomer',
  components: {
    jcTitle,
    JcBank,
    JcBusiness,
    JcContacts,
    jcMarker,
    unit: () => import('@/views/basic/createMateriel2/components/unit'),
    supplier: () => import('@/views/purchasing/purchase/treePurchasePrice/component/supplier'),
    jcButton,
    country: () => import('@/views/purchasing/supplier/createSupplier/components/country')
  },
  mixins: [searData, operability, autocomplete, bility],
  data() {
    return {
      funit: '',
      unitVisabled: false,
      supplierVisiblit: false,
      activeName: 'customer', // 默认基本信息
      ftype: 2052,
      fbillNo: 'fname', // 编码
      targerName: 'customer',
      fcustId: '', // 客户id
      dialogVisible: false,
      cityName: '', // 城市名称
      otherUrlObject: {},
      treeClickCount: 0, // 点击次数
      // 头部信息
      organization: {
        fuseOrgArray: [],
        fname: '', // 客户名称
        fcode: '' // 客户编码
      },
      // 基础数据
      basic: {},
      administration: { },
      relevant: {},
      // 联系人
      contactsValue: {},
      // 商务信息
      business: {},
      tableBankData: [
        {
          fentryId: 0,
          fcountry: '', // 开户行国家
          fbankcode: '', // 银行账号
          fcurrency: '',
          fcurrencyId: '', // 币别id
          faccountName: '' // 账户名称
        }
      ],
      isDisabled: false,
      openCountry: false, // 国家
      openCustomer: false, // 客户分组
      total: 0, // 总条目
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      // 操作记录
      optionValue: {},
      optionsForm: {},
      tableData: [], // 表格数据
      operationHeader: [
        { label: this.$t('shop.name1'), prop: 'fname' },
        { label: this.$t('market.deaprt'), prop: 'fdeaprt' },
        { label: this.$t('market.handle'), prop: 'fdescribe' },
        { label: this.$t('market.ipSite'), prop: 'fip' },
        { label: this.$t('market.createDate'), prop: 'createDate' }
      ],
      tablePagination: {
        pageNum: 1,
        pageSize: 10
      },
      basicRules: {
        fcountry: [
          {
            required: true,
            message: '请选择国家',
            trigger: 'blur'
          }
        ]
      },
      nameRules: {
        fname: [{ required: true, message: '请输入客户名称', trigger: 'blur' }]
      },
      adminRules: {
        ftel: [{ required: true, message: '请输入联系人电话', trigger: 'blur' }]
      },
      relevantRules: {
        fcustTypeId: [
          {
            required: true,
            message: '请选择客户类别',
            trigger: 'change'
          }
        ],
        fgroup: [
          {
            required: true,
            message: '请选择客户分组',
            trigger: 'change'
          }
        ]
      }
    }
  },
  created() {
    this.getForm()
  },
  methods: {
    // 表单基础验证公用函数
    validationRules(refRules) {
      let value = null
      refRules(valid => {
        if (valid) {
          value = true
        } else {
          value = false
        }
      })
      return value
    },
    // 提交
    save(ev) {
      // 组织客户名称
      const name = this.validationRules(this.$refs.nameRef.validate)
      // 联系人电话
      const contactsId = this.$refs.contactsRef.handleContactRef()
      // 商务信息
      const business = this.$refs.businessRef.handleBusinessRef()
      // 国家必选
      const countryId = this.validationRules(this.$refs.basicRef.validate)
      // 联系人电话必选
      const callId = this.validationRules(this.$refs.callRef.validate)
      // 客户类别和客户分组必选
      const customerId = this.validationRules(this.$refs.customerRef.validate)
      // 用户Id
      this.fcustId = this.$route.params.id
      if (
        !countryId ||
        !customerId ||
        !callId ||
        !business ||
        !contactsId ||
        !name ||
        !this.fcustId
      ) {
        return
      }
      for (const item of this.tableBankData) {
        const result = Object.values(item).includes('')
        if (result) {
          this.$message.warning('银行信息不能为空！')
          return
        }
      }
      // 公司第一列
      const {
        fcountry, // 国家
        faddress, // 通讯地址
        fwebsite // 公司网站
      } = this.basic
      const {
        ftel, // 联系电话
        ffax, // 传真
        ftaxregistercode, // 纳税登记号
        fcompanyclassify, // 公司类别
        fcompanynature, // 公司性质
        fcompanyscale // 公司规模
      } = this.administration
      const {
        fsupplier,
        fsupplierid,
        fcorrespondorgid,
        fcustTypeId, // 客户类别id
        fgroup, // 客户分组id
        fdescription // 备注
      } = this.relevant
      const {
        ftradingCurrId, // 结算币别id  1
        fsaldeptId, // 销售部门id
        fsalgroupId, // 销售组id
        fsellerId, // 销售员id
        fsettleTypeId, // 结算方式id  1
        freccondiTionId, // 收款条件id  1
        fpricelistid, // 价目表
        fdiscountlist, // 折扣表
        ftransleadTime, // 运输提前期
        ftaxType, // 税分类  1
        ftaxTypeName,
        finvoiceType, // 发票类型   1
        finvoiceTypeName,
        ftaxRate // 默认税率  1
      } = this.business
      const data = {
        fname: this.organization.fname,
        // 客户id
        fcustId: this.fcustId,
        // 公司第一列
        fcorrespondorgid,
        fsupplier,
        fsupplierid,
        fcountry,
        faddress,
        fwebsite,
        ftel, // 联系电话
        ffax, // 传真
        ftaxregistercode, // 纳税登记号
        fcompanyclassify, // 公司类别
        fcompanynature, // 公司性质
        fcompanyscale, // 公司规模
        fcustTypeId, // 客户类别id
        fgroup, // 客户分组id
        fdescription, // 备注
        ftradingCurrId, // 结算币别id  1
        fsaldeptId, // 销售部门id
        fsalgroupId, // 销售组id
        fsellerId, // 销售员id
        fsettleTypeId, // 结算方式id  1
        freccondiTionId, // 收款条件id  1
        fpricelistid, // 价目表
        fdiscountlist, // 折扣表
        ftransleadTime, // 运输提前期
        ftaxType, // 税分类  1
        ftaxTypeName,
        finvoiceType, // 发票类型   1
        finvoiceTypeName,
        ftaxRate, // 默认税率  1
        // 表格
        custBank: this.tableBankData
      }
      Object.assign(data, this.contactsValue)
      updateCustomer(data).then(res => {
        if (res.code !== 0) {
          this.$message({ showClose: true, message: res.message, type: 'error' })
          return
        }
        ev === 1 ? this.materSub(1) : this.getForm()
        this.$message({ showClose: true, message: res.message, type: 'success' })
      })
    },
    async handleGroup() {
      this.openCustomer = true
      const { data: res } = await queryCustomerGroup()
      this.relevant.fgroupArray = res
    },
    // 客户分组
    handleNodeClick(item) {
      this.treeClickCount++
      if (this.treeClickCount >= 2) return
      this.timer = window.setTimeout(() => {
        if (this.treeClickCount === 1) {
          this.treeClickCount = 0
        } else if (this.treeClickCount > 1) {
          this.treeClickCount = 0
          const { value, label } = item
          this.relevant.fgroup = value
          this.relevant.fgroupName = label
          this.openCustomer = false
        }
      }, 300)
    },
    // 国家选中
    countrySelectRow(ev) {
      if (ev.fcountry) {
        const basic = this.basic
        basic.fcountryName = ev.fcountryname
        basic.fcountry = ev.fcountry
      }
      this.openCountry = false
    },
    // 数据字典弹窗
    cliUnit(ev) {
      this.funit = ev
      this.unitVisabled = true
    },
    // 数据字典选中
    selUnit(ev) {
      if (ev.fid) {
        if (this.funit === 'SX_COMPANYTYPE') { // 公司类型
          this.administration.fcompanyclassifyName = ev.fname
          this.administration.fcompanyclassify = ev.fid
        } else if (this.funit === 'SX_COMPANYNATURE') { // 公司性质
          this.administration.fcompanynatureName = ev.fname
          this.administration.fcompanynature = ev.fid
        } else if (this.funit === 'SX_COMPANYSCALE') { // 公司规模
          this.administration.fcompanyscaleName = ev.fname
          this.administration.fcompanyscale = ev.fid
        } else if (this.funit === 'SX_CUSTCATEGORY') { // 客户类别
          this.relevant.fcustTypeName = ev.fname
          this.relevant.fcustTypeId = ev.fid
        }
      }
      this.unitVisabled = false
    },
    // 关闭弹窗事件
    closeDialog() {
      this.openCountry = false
      Object.keys(this.searCollData).forEach(key => {
        this.searCollData[key] = ''
      })
    },
    // 操作记录
    async handleClick(tab) {
      if (tab.name === 'log') {
        await this.$refs.log.otherlog()
      }
    },
    // 获取供应商
    supplierData(ev) {
      if (ev.fsupplierId) {
        this.relevant.fsupplierid = ev.fsupplierId
        this.relevant.fsupplier = ev.fname
      }
      this.supplierVisiblit = false
    },
    // 获取数据
    async getForm() {
      this.fcustId = this.$route.params.id
      const { data: res } = await queryCustomerDetails({
        fcustId: this.fcustId
      })
      this.tableBankData = res.custBank
      const {
        fname,
        fnumber,
        fcountry,
        fcountryName,
        faddress,
        fwebsite,
        ftel,
        ffax,
        ftaxregistercode,
        fcompanyclassify,
        fcompanyclassifyName,
        fuseOrgId,
        fcompanynature,
        fcompanynatureName,
        fcompanyscale,
        fcompanyscaleName,
        fcustTypeId,
        fcustTypeName,
        fgroup,
        fgroupName,
        fdescription,
        fcontacts,
        ftels,
        fmailbox,
        flegalContacts,
        flegalTels,
        flegalMailbox,
        fbusinessContacts,
        fbusinessTels,
        fbusinessMailbox,
        ffinanceContacts,
        ffinanceTels,
        ffinanceMailbox,
        coopeartiondate,
        ftradingCurrId,
        ftradingCurrName,
        fsaldeptId,
        fsaldeptName,
        fsalgroupId,
        fsalgroupName,
        fsellerId,
        fsellerName,
        fsettleTypeId,
        fsettleTypeName,
        freccondiTionId,
        freccondiTionName,
        fdiscountlist,
        ftransleadTime,
        ftaxType,
        ftaxTypeName,
        finvoiceType,
        finvoiceTypeName,
        ftaxRate,
        ftaxRateName,
        fdocumentStatus,
        stateColor,
        fcreator,
        fcreateDate,
        fmodifier,
        fmodifyDate,
        fapprover,
        fapproveDate,
        fforbider,
        fforbidDate,
        fcorrespondorgid,
        fsupplier,
        fsupplierid
      } = toMxAmina(res)
      this.otherUrlObject = {
        fcreator,
        fcreateDate,
        fmodifier,
        fmodifyDate,
        fapprover,
        fapproveDate,
        fforbider,
        fforbidDate
      }
      this.organization = {
        fname,
        fuseOrgId,
        fdocumentStatus,
        stateColor,
        fcode: fnumber
      }
      this.isDisabled = this.organization.fdocumentStatus === this.$t('market.state1') || this.organization.fdocumentStatus === this.$t('market.state2')
      this.basic = {
        fcountry, // 国家
        fcountryName,
        faddress,
        fwebsite
      }
      this.administration = {
        ftel,
        ffax,
        ftaxregistercode,
        fcompanyclassify,
        fcompanyclassifyName,
        fcompanynature,
        fcompanynatureName,
        fcompanyscale,
        fcompanyscaleName
      }
      this.relevant = {
        fsupplier,
        fsupplierid,
        fcorrespondorgid,
        fcustTypeName,
        fcustTypeId,
        fgroup,
        fgroupName,
        fdescription
      }
      this.contactsValue = {
        fcontacts,
        ftels: Number(ftels),
        fmailbox,
        flegalContacts,
        flegalTels: Number(flegalTels),
        flegalMailbox,
        fbusinessContacts,
        fbusinessTels: Number(fbusinessTels),
        fbusinessMailbox,
        ffinanceContacts,
        ffinanceTels: Number(ffinanceTels),
        ffinanceMailbox,
        coopeartiondate
      }
      this.business = {
        finvoiceTypeArray: this.business.finvoiceTypeArray,
        ftaxTypeArray: this.business.ftaxTypeArray,
        ftradingCurrId,
        ftradingCurr: ftradingCurrName,
        fsaldeptId,
        fsaldept: fsaldeptName,
        fsalgroupId,
        fsalgroup: fsalgroupName,
        fsellerId,
        fseller: fsellerName,
        fsettleTypeId,
        fsettleType: fsettleTypeName,
        freccondiTionId,
        freccondiTion: freccondiTionName,
        fdiscountlist,
        ftransleadTime,
        ftaxType,
        ftaxTypeName,
        finvoiceType,
        finvoiceTypeName,
        ftaxRate,
        ftaxRateName
      }
    },
    // 公共函数
    toExamineFun(api) {
      const DATA = { Numbers: [this.organization.fcode] }
      api(DATA).then(res => {
        if (res.code !== 0) {
          this.$confirm(res.message, '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'error'
          })
          return
        }
        this.getForm()
        this.innerHTM = ''
        res.data.forEach(res => {
          this.innerHTM += '<div>' + res + '</div>'
        })
        this.$notify.warning({
          title: '提示',
          message: this.innerHTM,
          duration: 3000, offset: 50,
          dangerouslyUseHTMLString: true
        })
      })
    },
    // 提交
    async materSub(ev) {
      const api = ev === 1 ? custSubmit : custAuSubmit
      this.toExamineFun(api)
    },
    // 审核
    async Retrial(ev) {
      const api = ev === 1 ? custAudit : custUnAudit
      this.toExamineFun(api)
    },
    // 禁用反禁用
    async using(ev) {
      const api = ev === 1 ? disableCust : undisableCust
      this.toExamineFun(api)
    },
    // 删除
    delCustom() {
      this.$confirm('确定要删除么？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'error'
      }).then(() => {
        const DATA = { Numbers: [this.organization.fcode] }
        deleteCustomer(DATA).then(res => {
          if (res.code === 0) {
            // 关闭当前页面
            this.$store.dispatch('tagsView/guanbi', this.$route)
            this.$router.push({ path: '/customerList' })
            this.$message({ showClose: true, message: res.message, type: 'success' })
          } else {
            this.$confirm(res.message, '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'error'
            })
          }
        })
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import 'src/styles/customer/inedx';
.content {
  @include listBom;
  .marL {
    margin-left: 10px;
  }
  .el-input::v-deep .el-input__inner {
    height: 30px;
    line-height: 30px;
  }
  .el-form-item {
    height: 35px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
  }
}
</style>
